import request from '../utils/request'

export function login(data) {
  return request({
    url: '/login/login',
    method: 'post',
    data
  })
}

export function register(data) {
  return request({
    url: '/webapi/HrPersonal/add',
    method: 'post',
    data
  })
}

export function collection(params) { // 收藏 page 每页的页数  rows 请求的条数
  return request({
    url: '/user/collectionList',
    method: 'get',
    params
  })
}

export function browse(params) { // 最近浏览 page 每页的页数  rows 请求的条数
  return request({
    url: '/user/browseList',
    method: 'get',
    params
  })
}

export function updateUserInfo(data) {
  return request({
    url: '/user/updateUserInfo',
    method: 'post',
    data
  })
}

export function uploadUserHeadImg(data) {
  return request({
    url: '/user/uploadUserHeadImg',
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data
  })
}

export function userLoginOut(data) {
  return request({
    url: '/user/loginOut',
    method: 'post',
    data
  })
}

export function userAddUser(data) {
  return request({
    url: '/user/appAddUser',
    method: 'post',
    data
  })
}

export function updatePassword(data) {
  return request({
    url: '/user/updatePassword',
    method: 'post',
    data
  })
}
